﻿@model Guardian.Domain.QueryListResult<Guardian.Domain.Target.TargetDto>
@{
    ViewData["Title"] = "Home Page";
}

<div class="text-center">
    <h1 class="display-4">Targets</h1>
    <hr />
    <div>
        <a class="btn btn-primary" asp-area="" asp-controller="Targets" asp-action="Create">Create</a>
    </div>
    <br />
    @if (Model.IsSucceeded && Model.Count > 0)
    {
        <table class="table">
            <thead>
                <tr>
                    <th>
                        Domain
                    </th>
                    <th>
                        Origin IP Address
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Result)
                {
                    <tr>
                        <td>
                            @item.Domain
                        </td>
                        <td>
                            @item.OriginIpAddress
                        </td>
                        <td>
                            <a class="btn btn-sm btn-info" asp-action="Details" asp-route-id="@item.Id">Details</a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    }
</div>
